package com.robot.api.controller;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.robot.api.controller.base.BaseController;
import com.robot.api.dto.UserDTO;
import com.robot.api.service.LoginService;


@Controller
public class LoginController extends BaseController {
	
	@Autowired
	private LoginService loginService;
    
	

	/**
	 * login
	 * @param UserDTO
	 * @return
	 */
	@RequestMapping(method = RequestMethod.POST, value = "/login")
	@ResponseBody
	public Map<String, String> login(@RequestBody UserDTO user){
		Map<String, String> result = new HashMap<String, String>(2);
		result = loginService.login(user);
		return result;
	}
	

}

